<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\models\article\Article */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => '文章列表', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="article-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('修改', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('删除', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => '是否删除 ^_^ ?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'title',
            'short_title',
            [
                'attribute' => 'thumb',
                'value'=> Html::img($model->thumb),
                'format'=>'html',
            ],
            'description',
            'content:html',
            // 'search_key',
            'channel_id',
            [
                'attribute' => 'add_time',
                'label'=> '添加时间',
                'value'=> function($model){
                    return  date('Y-m-d H:i:s',$model->add_time);
                }
            ],
            [
                'attribute' => 'edit_time',
                'label'=> '修改时间',
                'value'=> function($model){
                    return  date('Y-m-d H:i:s',$model->edit_time);
                }
            ],
            // 'html_path',
            // 'is_hidden',
            // 'is_del',
        ],
    ]) ?>

</div>
